package com.ics.atable.chat.model.vo.history;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * 对话历史VO
 *
 * @author haohongbin
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "对话历史VO")
public class ChatHistoryVO implements Serializable {


    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "消息ID")
    private Long messageId;

    /**
     * 会话ID
     */
    @Schema(description = "会话ID")
    private String sessionId;

    /**
     * 角色：user-用户，assistant-助手，system-系统
     */
    @Schema(description = "角色")
    private String role;

    /**
     * 消息内容
     */
    @Schema(description = "消息内容")
    private Object content;

    /**
     * 消息类型：text-文本，sql-SQL查询，result-查询结果，error-错误
     */
    @Schema(description = "消息类型")
    private String messageType;

    /**
     * 元数据（JSON格式）
     */
    @Schema(description = "元数据（JSON格式）")
    private Object metadata;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;

}